ui: fix client detail page error#27822
ui: fix client detail page error#27822arunstanhc wants to merge 12 commits intoNMD-917-core-issuefrom
Conversation
|
Moving to draft to fix failing tests |
|
Hi @arunstanhc, would you mind pulling the node metrics changes into a follow up PR, it would make this one a bit easier to review. |
|
|
||
| // Refresh to reload with new region data | ||
| this.refresh(); | ||
| }, 0); |
There was a problem hiding this comment.
Why schedule this to run 0 ms later instead of executing it right away or setting a timeout value?
There was a problem hiding this comment.
@tehut this.refresh will basically reload the route and since we are already in a route transition (in the beforeModel phase of a route change) ember would interrupt or abort the current route transition. By using a 0 value for the later method here, we are ensuring the call to refresh is only made on the next "tick" of the run loop which would be after the current transition is complete
| this.system.set('activeRegion', region); | ||
| await this.get('token.fetchSelfTokenAndPolicies').perform().catch(); | ||
| // Fetch token for the new region before transitioning | ||
| await this.get('token.fetchSelfTokenAndPolicies').perform(region).catch(); |
There was a problem hiding this comment.
I wonder if we shouldn't set a default or retry in the catch block now that ln 25 is setting the value instead of overwriting an existing value.
There was a problem hiding this comment.
Good point @tehut. We do set the active region in application route beforeModel, which will be triggered after this line and in case token and policies fetch fails, the last successful values will be used. Also the application router error handler will show the error if there is an error with the token
Hello @tehut Sure thing, I have now created a new PR which address the core issue of NMD-917 and the other changes will be in this PR. Weirdly I cannot replicate the issue in clients details page (for which I added the changes in node metrics) anymore so I am moving this to draft and will make it ready after more testing. |
Description
This PR fixes the issue when allocations view is not updated when switching region. This leads to user seeing incorrect data and further errors when they try to interact with it - for eg. trying to access a job not existing in the newly switched region.
The changes in the PR are as below:
store.unloadAllwhich was causing rendering errors and replaced it withroute.refreshto reload active route models for the selected regionTesting & Reproduction steps
To reproduce the issue, set up Nomad instances with two regions and deploy a job to the federated cluster.
To verify the fix, please make another build with the PR branch and repeat the above steps
You should see updated data for relevant region without any errors
Including the files mentioned above for reference:
NMD917-test-files.zip
Links
JIRA
Contributor Checklist
changelog entry using the
make clcommand.ensure regressions will be caught.
and job configuration, please update the Nomad product documentation, which is stored in the
web-unified-docsrepo. Refer to theweb-unified-docscontributor guide for docs guidelines.Please also consider whether the change requires notes within the upgrade
guide. If you would like help with the docs, tag the
nomad-docsteam in this PR.Reviewer Checklist
backporting document.
in the majority of situations. The main exceptions are long-lived feature branches or merges where
history should be preserved.
within the public repository.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.